home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ian & Stuart's Australian Mac 1993 September
/
September 93.iso
/
Archives
/
Sound
/
MIDI
/
MIDI Utilities
/
MIDI Basic
/
Midi Test
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1986-09-29
|
2KB
|
43 lines
REM "MIDITEST" - MIDIBASIC Example Program 2 by Allen Marsalis
LIBRARY "MIDIBASIC" : MIDIOPEN 800,100 : GOSUB Port : GOSUB Clock
PRINT "Control bytes are in column 1, data bytes are in columns 2-13."
PRINT "Ready to play... Hit Mouse Button for Options"
MIDIfilter 1,254,254,0 : REM remove to see "active sense"
MIDI 0
AwaitInput:
MIDIin x% : IF x%=-1 THEN TestMouse
IF x%>=128 THEN PRINT
PRINT RIGHT$(SPACE$(9)+STR$(x%),9-LEN(STR$(x%)));
IF POS(0)>=50 THEN PRINT : PRINT SPACE$(8);
TestMouse:
IF MOUSE(0)>=0 THEN AwaitInput
PRINT : PRINT "(P)ort (C)lock (M)idi (F)ilter (S)end (Q)uit <return>"
INPUT "Enter character selection then hit <return> ";s$
IF LEN(s$)<>1 THEN AwaitInput
IF s$>"Z" THEN s$=CHR$(ASC(s$)-32) : REM make upper case
ON INSTR("PCMFSQ",s$) GOSUB Port,Clock,Command,Filter,Send,Quit
GOTO AwaitInput
Port:
INPUT "(C)ommunications or (P)rinter port ";s$
IF s$="C" OR s$="c" THEN MIDIport 3
IF s$="P" OR s$="p" THEN MIDIport 4
RETURN
Clock:
INPUT "(0).5 (1) (2) MHz interface ";x% : MIDIport x% : RETURN
Command:
INPUT "MIDI command to output (0-6) ";x% : MIDI x% : RETURN
Filter:
INPUT "Filter (1-8) ";n
IF n=0 THEN MIDIfilter 0 : RETURN
INPUT "LOWER Limit (0-255) ";lower
INPUT "UPPER Limit (0-255) ";upper
INPUT "Bytes to skip (0-255) ";skip
MIDIfilter n,lower,upper,skip : RETURN
Send:
INPUT "Note to send ";s%
x%=144 : MIDIout x% : MIDIout s% : x%=64 : MIDIout x%
FOR i=1 TO 2000: NEXT
x%=144 : MIDIout x% : MIDIout s% : x%=0 : MIDIout x% : RETURN
Quit:
LIBRARY CLOSE : PRINT "MIDIBASICâ„¢ library closed" : END